# Maintainer: Minggang Li <minggang.li@gmail.com>
# Build instructions:
#   1) Download boost from boost.org(1.71 or later) and wxWidgets from wxWidgets.org or install wxgtk-dev(3.0.x or later)
#      and change the './configure ...' accordingly
#   2) Extract('tar -xvf ...') the source code packages at your {HOME} or other(change the {HOME} in './configure ...')
#   3) Run 'makepkg' under the directory of this file

boost=${HOME}/boost_1_82_0
wxWidgets=${HOME}/wxWidgets-3.2.2.1
pkgname=madedit-mod
pkgver=$MADEDIT_VERSION
pkgrel=1
pkgdesc="Cross-platform Text/Hex Editor, a fork of MadEdit with bug fixes and enhancements"
arch=("i686" "x86_64")
url="https://github.com/LiMinggang/madedit-mod"
license=('GPL')
source=("https://github.com/LiMinggang/madedit-mod/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('SKIP')

build() {
  cd "$srcdir/madedit-mod-$pkgver"

  sh ./autogen.sh

  sh ./configure --prefix=/usr --with-boost=$boost --with-wxdir=$wxWidgets --with-gtk=3
  make
}

package() {
  cd "$srcdir/madedit-mod-$pkgver"
  make DESTDIR="${pkgdir}" install
}
